<?php

namespace App\Admin\Grids;

use App\Models\Msg;
use Dcat\Admin\Grid;
use Dcat\Admin\Grid\LazyRenderable;
class MsgList extends LazyRenderable
{


    public function grid(): Grid
    {
        $uid = $this->payload['uid'];
        // TODO: Implement grid() method.
        return  Grid::make(new Msg(), function (Grid $grid) use($uid)
        {
            $grid->tools('<a class="btn btn-primary disable-outline" style="color : #fff" href="/admin/msg?pid='.$uid.'">去导出</a>');
            $grid->model()->where('pid',$uid);
            $grid->column('post','发件人');
            $grid->column('contend','内容');
            $grid->column('created_at');
            $grid->disableActions();
        });
    }
}